package com.ehome.poct.base.dao.device.repository;

import com.ehome.mybatisplus.support.AbstractCrudRepository;
import com.ehome.poct.base.api.dto.device.*;
import com.ehome.poct.base.dao.device.entity.TestDeviceVersionRelationDO;
import com.ehome.poct.base.dao.device.mapper.TestDeviceVersionRelationMapper;
import com.ehome.poct.base.device.repository.TestDeviceVersionRelationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 设备和版本关联表RepositoryImpl
 *
 * @author yjm
 * @Date 2021-12-13 15:52
 */
@Repository
public class TestDeviceVersionRelationRepositoryImpl extends AbstractCrudRepository<TestDeviceVersionRelationDO, TestDeviceVersionRelationDTO> implements TestDeviceVersionRelationRepository {
    
    @Autowired
    private TestDeviceVersionRelationMapper mapper;
    
    @Override
    public String topOneVersion(TestVersionRelationQry qry) {
        return mapper.topOneVersion(qry);
    }
    
    @Override
    public Integer topOneVersionCount(TestVersionRelationQry qry) {
        return mapper.topOneVersionCount(qry);
    }
    
    @Override
    public Integer versionCount(VersionQry qry) {
        return mapper.versionCount(qry);
    }
    
    @Override
    public List<TestDeviceVersionDataDTO> getDeviceVersionData(TestVersionRelationQry qry) {
        return mapper.getversions(qry);
    }
}
